<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <link rel="icon" href="../../images/hospital-icon.png" type="image/x-icon">  <!--在网页标题左侧显示图标-->
    <!--    <link rel="shortcut icon" href="./images/hospital-icon.png" type="image/x-svg">-->
    <link rel="shortcut icon" href="../../images/hospital-icon.png" type="image/x-icon"><!--在收藏夹显示图标-->

    <title>医嘱管理-门诊管理系统</title>

    <!--时间风格及输入框风格-->
    <!--pickers css-->
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-datepicker/css/datepicker-custom.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-timepicker/css/timepicker.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-colorpicker/css/colorpicker.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-daterangepicker/daterangepicker-bs3.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-datetimepicker/css/datetimepicker-custom.css" />

    <link href="../../css/style.css" rel="stylesheet">
    <link href="../../css/style-responsive.css" rel="stylesheet">
    <!--时间风格及输入框风格-->

    <!--data table-->
    <link rel="stylesheet" href="../../js/data-tables/DT_bootstrap.css" />

    <link href="../../css/style.css" rel="stylesheet">
    <link href="../../css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="../../js/html5shiv.js"></script>
    <script src="../../js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <!--左侧开始-->
    <div class="left-side sticky-left-side">

        <!--logo and iconic logo start-->
        <!--侧边栏顶部图标+文字-->
        <div class="logo">
            <a href="index_doctor.html">
                <img src="../../images/hospital-icon.png" alt="" style="width: 40px;height: 40px">
                <p style="display: inline-block;font-size: 24px;">门诊管理系统</p>
            </a>
        </div>

        <!--收起状态的侧边栏顶部图标-->
        <div class="logo-icon text-center">
            <a href="index_doctor.html"><img src="../../images/hospital-icon.png" alt="" style="width: 40px;height: 40px"></a>
        </div>
        <!--logo and iconic logo end-->

        <div class="left-side-inner">

            <!--sidebar nav start-->
            <!--侧边栏-->
            <ul class="nav nav-pills nav-stacked custom-nav">

                <li class="menu-list nav-active">
                    <a href="">
                        <i class="fa fa-book"></i>
                        <span>门诊管理</span>
                    </a>
                    <ul class="sub-menu-list">
                        <li><a href="emrList.html"> 电子病历管理</a></li>
                        <li class="active"><a href="orderList.html"> 医嘱管理</a></li>
                    </ul>
                </li>

                <li class="logout">
                    <a href="#">
                        <i class="fa fa-sign-in"></i>
                        <span>退出登录</span>
                    </a>
                </li>

            </ul>
            <!--sidebar nav end-->
            <!--侧边栏导航结束-->

        </div>
    </div>
    <!-- left side end-->
    <!-- 左侧 部分 结束 -->

    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <!--顶部菜单部分开始-->
        <div class="header-section">

            <!--toggle button start-->
            <!--拨动按钮-收起侧边栏-->
            <a class="toggle-btn"><i class="fa fa-bars"></i></a>
            <!--toggle button end-->

            <!--notification menu start -->
            <!--通知菜单开始-->
            <div class="menu-right" id="headerApp">
                <ul class="notification-menu">

                    <li>
                        <a href="#" class="btn btn-default  info-number logout">
                            退出登录
                            <i class="fa fa-sign-out"></i>
                        </a>
                    </li>

                </ul>
            </div>
            <!--notification menu end -->
            <!--通知菜单结束-->
        </div>
        <!-- header section end-->
        <!--顶部菜单部分结束-->

        <!--body wrapper start-->
        <div class="wrapper" id="orderApp">
            <div class="row">
                <div class="col-sm-12">
                    <section class="panel">
                        <header class="panel-heading">
                            医嘱管理
                            <span class="tools pull-right"></span>
                        </header>
                        <div class="panel-body">
                            <div class="adv-table editable-table ">

                                <div class="clearfix"  style="margin-bottom: 20px">
                                    <form class="form-inline" role="form">

                                        <a href="#newAdmission" class="btn btn-info details" data-toggle="modal">
                                            新增
                                            <i class="fa fa-plus"></i>
                                        </a>

                                        <!-- Modal -->
                                        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="newAdmission" class="modal fade">
                                            <div class="modal-dialog">
                                                <div class="modal-content">
                                                    <div class="modal-header" style="width: auto;height: auto">
                                                        <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                                        <h4 class="modal-title">新增医嘱</h4>
                                                    </div>
                                                    <div class="modal-body"  style="width: auto;height: auto;position: relative">
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">选择电子病历:</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderEMRInput" @change="addOrderSelectEMRList()" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据患者姓名查询">
                                                                <ul role="menu" class="dropdown-menu" style="position: absolute;right: 15px">
                                                                    <li v-for="addOrderEmr in AddOrderEMRList">
                                                                        <a href="#" @click="addOrderCheckThisEMR(addOrderEmr.emrId,addOrderEmr.admissionId,addOrderEmr.patientId,addOrderEmr.patientName)">
                                                                            <span> 病历号:</span>
                                                                            <span v-text="addOrderEmr.emrId">1</span>
                                                                            <span> 入院号:</span>
                                                                            <span v-text="addOrderEmr.admissionId"> 曾晨</span>
                                                                            <span> 患者:</span>
                                                                            <span v-text="addOrderEmr.patientId"> 曾晨</span>
                                                                            <span> </span>
                                                                            <span v-text="addOrderEmr.patientName"> 4</span>
                                                                        </a>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">选择产品:</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderDrugInfoInput" @change="addOrderSelectDrugInfoList()" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据产品名称查询">
                                                                <ul role="menu" class="dropdown-menu" style="position: absolute;right: 15px">
                                                                    <li v-for="addOrderDrugInfo in AddOrderDrugInfoList">
                                                                        <a href="#" @click="addOrderCheckThisDrugInfo(addOrderDrugInfo.stockId,addOrderDrugInfo.departmentIdName,addOrderDrugInfo.itemId,addOrderDrugInfo.itemDescription,addOrderDrugInfo.unitName)">
                                                                            <span> 库存ID:</span>
                                                                            <span v-text="addOrderDrugInfo.stockId">1</span>
                                                                            <span> 药房名称:</span>
                                                                            <span v-text="addOrderDrugInfo.departmentIdName"> 曾晨</span>
                                                                            <span> 可用存量:</span>
                                                                            <span v-text="addOrderDrugInfo.availableQty"> </span>
                                                                            <span> 产品:</span>
                                                                            <span v-text="addOrderDrugInfo.itemId"> 曾晨</span>
                                                                            <span> </span>
                                                                            <span v-text="addOrderDrugInfo.itemDescription"> 4</span>
                                                                        </a>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div>

                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">发药量</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderSendQty" class="col-sm-12" type="text"  pattern="/[^\d.]/g,''" class="form-control" placeholder="请输入发药量">
                                                            </div>
                                                        </div>

                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">发药量基本单位</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderSendUnitName" class="col-sm-12" type="text" class="form-control" placeholder="请输入发药量基本单位" disabled>
                                                            </div>
                                                        </div>

                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">频次详情</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderFrequencyDetail" class="col-sm-12" type="text" class="form-control" placeholder="请输入频次详情">
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">补充频次详情</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderSupplementaryFrequencyDetail" class="col-sm-12" type="text" class="form-control" placeholder="请输入补充频次详情">
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">用餐时间详情</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addOrderMealTimeDetail" class="col-sm-12" type="text" class="form-control" placeholder="请输入用餐时间详情">
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer"  style="width: auto;height: auto;border: none">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                        <button type="button" class="btn btn-success" @click="addSaveOrderButton()">保存</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                <span v-text="selectPageSizeName">分页数</span>
                                                <span class="caret"></span>
                                            </button>
                                            <ul role="menu" class="dropdown-menu">
                                                <li><a href="#" @click="selectOrderCheckThisPageSize(10)">10</a></li>
                                                <li><a href="#" @click="selectOrderCheckThisPageSize(20)">20</a></li>
                                                <li><a href="#" @click="selectOrderCheckThisPageSize(30)">30</a></li>
                                            </ul>
                                        </div>

                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                <span v-text="selectSignatureFlagName">是否签名</span>
                                                <span class="caret"></span>
                                            </button>
                                            <ul role="menu" class="dropdown-menu">
                                                <li><a href="#" @click="selectOrderCheckThisSignatureFlag(1,'已签名')">已签名</a></li>
                                                <li><a href="#" @click="selectOrderCheckThisSignatureFlag(0,'未签名')">未签名</a></li>
                                            </ul>
                                        </div>

                                        <div class="form-group">
                                            <input v-model="selectOrderForOrderId" type="text" class="form-control" style="width: 300px" placeholder="根据医嘱号/病历号/处方号查询">
                                        </div>

                                        <div class="form-group">
                                            <input v-model="selectOrderForPatientName" type="text" class="form-control" style="width: 300px" placeholder="根据患者名称/患者ID查询">
                                        </div>

                                        <div class="form-group">
                                            <input v-model="selectOrderForItemName" type="text" class="form-control" style="width: 300px" placeholder="根据产品名称/产品简称/成分查询">
                                        </div>

                                        <button type="button" class="btn btn-info" @click="selectOrderListButton()">
                                            查询
                                            <i class="fa fa-search"></i>
                                        </button>
                                        <button type="button" class="btn btn-default" @click="selectOrderListButtonReset()">
                                            重置
                                            <i class="fa fa-undo"></i>
                                        </button>

                                    </form>
                                </div>


                                <table class="table table-striped table-hover table-bordered" id="editable-sample">
                                    <thead>
                                    <tr>
                                        <th>医嘱ID</th>
                                        <th>处方ID</th>
                                        <th>患者ID</th>
                                        <th>患者姓名</th>
                                        <th>病历号</th>
                                        <th>产品ID</th>
                                        <th>产品名称</th>
                                        <th>发药量</th>
                                        <th>发药量的单位名称</th>
                                        <th>频次详情</th>
                                        <th>补充频次详情</th>
                                        <th>用餐时间详情</th>
                                        <th>医生签名标记</th>
                                        <th>创建时间</th>
                                        <th>修改</th>
                                        <th>删除</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr class="" v-for="order in orderList">
                                        <td v-text="order.orderId">1</td>
                                        <td v-text="order.prescriptionId">1</td>
                                        <td v-text="order.patientId">1</td>
                                        <td v-text="order.patientName">曾晨</td>
                                        <td v-text="order.emrId">1</td>
                                        <td v-text="order.itemId">1</td>
                                        <td v-text="order.returnItemName">1</td>
                                        <td v-text="order.sendDose">马希利迪100mg/盒</td>
                                        <td v-text="order.sendDoseUnitName">1</td>
                                        <td v-text="order.frequencyDetail">盒</td>
                                        <td v-text="order.supplementaryFrequencyDetail">一天三次</td>
                                        <td v-text="order.mealTimeDetail">一周三天</td>
                                        <td>
                                            <span class="label label-info" v-if="order.doctorSignatureFlag==1">已签名</span>
                                            <span class="label label-default" v-if="order.doctorSignatureFlag==0">未签名</span>
                                        </td>
                                        <td v-text="order.returnCreateTime">1999-02-28</td>
                                        <td>
                                            <a href="#modifyOrder" class="details" style="color: #46b8da;" data-toggle="modal" @click="modifyClickButton(order.orderId)">修改</a>
                                        </td>

                                        <td>
                                            <a :href="'#deleteyMyAppointment' + order.orderId" class="details" style="color: #46b8da;" data-toggle="modal">删除</a>
                                            <!-- Modal -->
                                            <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" :id="'deleteyMyAppointment' + order.orderId" class="modal fade">
                                                <div class="modal-dialog">
                                                    <div class="modal-content">
                                                        <div class="modal-header" style="width: auto;height: auto">
                                                            <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                                            <h4 class="modal-title">删除医嘱</h4>
                                                        </div>
                                                        <div class="modal-body"  style="width: auto;height: auto;position: relative">
                                                            <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                                <label class="col-sm-4 control-label">是否确认删除医嘱</label>
                                                            </div>
                                                        </div>
                                                        <div class="modal-footer"  style="width: auto;height: auto;border: none">
                                                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                            <button type="button" class="btn btn-success" @click="deleteOrder(order.orderId)">保存</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>

                                <!--修改组件-->
                                <!-- Modal -->
                                <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="modifyOrder" class="modal fade">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header" style="width: auto;height: auto">
                                                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                                <h4 class="modal-title">修改医嘱</h4>
                                            </div>
                                            <div class="modal-body"  style="width: auto;height: auto;position: relative">
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">医嘱号:</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.orderId" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据医嘱查询" disabled>
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">处方号:</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.prescriptionId" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据处方号查询" :disabled="modifyOrderDetail.doctorSignatureFlag==1">
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">选择产品:</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.ItemPJName" @change="modifyOrderSelectDrugInfoList()" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据产品名称查询" :disabled="modifyOrderDetail.doctorSignatureFlag==1">
                                                        <ul role="menu" class="dropdown-menu" style="position: absolute;right: 15px">
                                                            <li v-for="modifyOrderDrugInfo in modifyOrderDrugInfoList">
                                                                <a href="#" @click="modifyOrderCheckThisDrugInfo(modifyOrderDrugInfo.stockId,modifyOrderDrugInfo.departmentIdName,modifyOrderDrugInfo.itemId,modifyOrderDrugInfo.itemDescription,modifyOrderDrugInfo.unitName)">
                                                                    <span> 库存ID:</span>
                                                                    <span v-text="modifyOrderDrugInfo.stockId">1</span>
                                                                    <span> 药房名称:</span>
                                                                    <span v-text="modifyOrderDrugInfo.departmentIdName"> 曾晨</span>
                                                                    <span> 可用存量:</span>
                                                                    <span v-text="modifyOrderDrugInfo.availableQty"> </span>
                                                                    <span> 产品:</span>
                                                                    <span v-text="modifyOrderDrugInfo.itemId"> 曾晨</span>
                                                                    <span> </span>
                                                                    <span v-text="modifyOrderDrugInfo.itemDescription"> 4</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>

                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">发药量</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.sendDose" class="col-sm-12" type="text"  pattern="/[^\d.]/g,''" class="form-control" placeholder="请输入发药量" :disabled="modifyOrderDetail.doctorSignatureFlag==1">
                                                    </div>
                                                </div>

                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">发药量基本单位</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.sendDoseUnitName" class="col-sm-12" type="text" class="form-control" placeholder="请输入发药量基本单位" disabled>
                                                    </div>
                                                </div>

                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">频次详情</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.frequencyDetail" class="col-sm-12" type="text" class="form-control" placeholder="请输入频次详情" :disabled="modifyOrderDetail.doctorSignatureFlag==1">
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">补充频次详情</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.supplementaryFrequencyDetail" class="col-sm-12" type="text" class="form-control" placeholder="请输入补充频次详情" :disabled="modifyOrderDetail.doctorSignatureFlag==1">
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">用餐时间详情</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyOrderDetail.mealTimeDetail" class="col-sm-12" type="text" class="form-control" placeholder="请输入用餐时间详情" :disabled="modifyOrderDetail.doctorSignatureFlag==1">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="modal-footer"  style="width: auto;height: auto;border: none">
                                                <div class="btn-group pull-left" style="margin-right: 15px">
                                                    <button type="button" class="btn btn-info" data-dismiss="modal" @click="modifyOrderDoctorSignatureList(modifyOrderDetail.orderId)">批量签名</button>
                                                </div>
                                                <div class="btn-group pull-left">
                                                    <button type="button" class="btn btn-info" data-dismiss="modal" v-if="modifyOrderDetail.doctorSignatureFlag==0" @click="modifyOrderDoctorSignature(modifyOrderDetail.orderId)">签名</button>
                                                    <button type="button" class="btn btn-info" data-dismiss="modal" disabled v-if="modifyOrderDetail.doctorSignatureFlag==1">已签名</button>
                                                </div>
                                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                <button type="button" class="btn btn-success" @click="modifySaveOrder(modifyOrderDetail.orderId)">保存</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="clearfix">
                                    <div class="btn-group">

                                    </div>
                                    <div class="btn-group pull-right">
                                        <ul class="pagination pagination-sm">
                                            <li><a href="#"  @click.prevent="selectClickOrderListPageNum(pageinfo.prePage)">上一页</a></li>
                                            <li v-for="n in pageinfo.navigatepageNums" @click.prevent="selectClickOrderListPageNum(n)" :class="{'active': n == pageinfo.pageNum}">
                                                <a href="#" v-text="n">1</a>
                                            </li>
                                            <li><a href="#" @click.prevent="selectClickOrderListPageNum(pageinfo.nextPage)">下一页</a></li>
                                        </ul>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <!--页脚部分开始-->
        <footer>
            2022 &copy; <a href="https://gitee.com/allen-zc/OutpatientManagementSystem" target="_blank">基于SSM的门诊管理系统</a>
            -
            <a href="https://gitee.com/allen-zc" target="_blank">AllenChen曾晨</a>
            -
            <p style="display: inline-block">ALL RIGHTS RESERVED.</p>
        </footer>
        <!--footer section end-->
        <!--页脚部分结束-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<script src="../../js/jquery-1.10.2.min.js"></script>
<script src="../../js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="../../js/jquery-migrate-1.2.1.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/modernizr.min.js"></script>
<script src="../../js/jquery.nicescroll.js"></script>

<!--时间风格及输入框风格-->
<!--pickers plugins-->
<script type="text/javascript" src="../../js/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-daterangepicker/moment.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
<!--pickers initialization-->
<script src="../../js/pickers-init.js"></script>
<!--时间风格及输入框风格-->

<!--data table-->
<script type="text/javascript" src="../../js/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="../../js/data-tables/DT_bootstrap.js"></script>

<!--common scripts for all pages-->
<script src="../../js/scripts.js"></script>


<script src="https://unpkg.zhimg.com/vue"></script>
<!--&lt;!&ndash; 开发环境版本，包含了有帮助的命令行警告 &ndash;&gt;-->
<!--<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>-->
<!--&lt;!&ndash; 生产环境版本，优化了尺寸和速度 &ndash;&gt;-->
<!--<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>-->
<!--axios-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>

<!--退出登录的方法-->
<script  type="text/javascript" charset="GB2312"  src="../../userjs/logout.js"></script>
<!--工具箱-->
<script src="../../js/utils.js"></script>

<script>

    let orderApp = new Vue({
        el:'#orderApp',
        data:{
            addOrderEMRInput:'',
            AddOrderEMRList:[],
            addCheckEmrId:'',
            addOrderDrugInfoInput:'',
            AddOrderDrugInfoList:[],
            addCheckDrugInfoId:'',
            addOrderSendQty:'',
            addOrderSendUnitName:'',
            addOrderFrequencyDetail:'',
            addOrderSupplementaryFrequencyDetail:'',
            addOrderMealTimeDetail:'',

            selectOrderForOrderId:'',
            selectOrderForPatientName:'',
            selectOrderForItemName:'',
            selectPageSizeName: '分页数',
            selectPageSize: '10',
            selectPageNum: '1',
            selectSignatureFlagName:'是否签名',
            selectSignatureFlag:'',
            orderList:[],
            pageinfo:{},

            modifyOrderDetail:{},
            modifyOrderDrugInfoList:[]
        },
        methods:{
            // 新增 搜索电子病历
            addOrderSelectEMRList:function () {
                let form = new FormData();
                form.append("patientName",this.addOrderEMRInput);
                axios({
                    url:"/oms/emr/selectEMRList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.AddOrderEMRList = res.data.list;
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 新增 选择电子病历
            addOrderCheckThisEMR:function (emrId,admissionId,patientId,patientName) {
                this.addCheckEmrId = emrId
                this.addOrderEMRInput = '病历号:' + emrId + '  入院号:' + admissionId + '   患者:' + patientId + '' + patientName
            },
            // 新增 搜索产品库存
            addOrderSelectDrugInfoList:function () {
                let form = new FormData();
                form.append("itemDescription",this.addOrderDrugInfoInput);
                axios({
                    url:"/oms/drug/selectDrugInfoList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.AddOrderDrugInfoList = res.data.list;
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 新增 选择药品库存
            addOrderCheckThisDrugInfo:function (stockId,departmentIdName,itemId,itemDescription,unitName) {
                this.addCheckDrugInfoId = stockId
                this.addOrderDrugInfoInput = '库存ID:' + stockId + ' 药房名称:' + departmentIdName + ' 产品:' + itemId + ' ' + itemDescription
                this.addOrderSendUnitName = unitName

                // 根据产品ID找产品返回频次详情等信息
                let form = new FormData();
                form.append("itemId",itemId);
                axios({
                    url:"/oms/item/selectItemDetail",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.addOrderFrequencyDetail = res.data.frequencyDetail
                    orderApp.addOrderSupplementaryFrequencyDetail = res.data.supplementaryFrequencyDetail
                    orderApp.addOrderMealTimeDetail = res.data.mealTimeDetail
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 新增 保存医嘱信息
            addSaveOrderButton:function () {
                // 根据产品ID找产品返回频次详情等信息
                let form = new FormData();
                form.append("emrId",this.addCheckEmrId);
                form.append("itemId",this.addCheckDrugInfoId);
                form.append("sendDose",this.addOrderSendQty);
                form.append("frequencyDetail",this.addOrderFrequencyDetail);
                form.append("supplementaryFrequencyDetail",this.addOrderSupplementaryFrequencyDetail);
                form.append("mealTimeDetail",this.addOrderMealTimeDetail);
                axios({
                    url:"/oms/order/addOrder",
                    method:"post",
                    data:form
                }).then(function (res) {
                    if (res.data=='ok'){
                        alert("新增成功")
                        location.reload();
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 查询 搜索按钮
            selectOrderListButton:function () {
                if (this.selectPageNum==null||this.selectPageNum==''){
                    this.selectPageNum=1
                }
                if (this.selectPageSize==null||this.selectPageSize==''){
                    this.selectPageSize=10
                }
                let form = new FormData();
                form.append("orderId",this.selectOrderForOrderId);
                form.append("patientName",this.selectOrderForPatientName);
                form.append("itemName",this.selectOrderForItemName);
                form.append("doctorSignatureFlag",this.selectSignatureFlag);

                form.append("pageNum",this.selectPageNum);
                form.append("pageSize",this.selectPageSize);
                axios({
                    url:"/oms/order/selectOrderList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.orderList = res.data.list
                    orderApp.pageinfo = res.data
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })

            },
            // 查询 重置
            selectOrderListButtonReset:function () {
                this.selectOrderForOrderId=''
                this.selectOrderForPatientName=''
                this.selectOrderForItemName=''
                this.selectPageSizeName='分页数'
                this.selectPageSize='10'
                this.selectPageNum='1'
                this.selectSignatureFlagName='是否签名'
                this.selectSignatureFlag=''
                this.orderList=[]
                this.pageInfo={}
                this.selectOrderListButton()
            },
            // 查询 选择分页数
            selectOrderCheckThisPageSize:function (pageSize) {
                this.selectPageSize = pageSize
                this.selectPageSizeName = pageSize
            },
            // 查询 选择是否签名
            selectOrderCheckThisSignatureFlag:function (signatureFlag,signatureFlagName) {
                this.selectSignatureFlag = signatureFlag
                this.selectSignatureFlagName = signatureFlagName
            },
            // 查询 选择上一页下一页
            selectClickOrderListPageNum:function (pageNum) {
                this.selectPageNum=pageNum
                this.selectOrderListButton()
            },
            // 修改 查询医嘱详情
            modifyClickButton:function (orderId) {
                let form = new FormData();
                form.append("orderId",orderId);
                axios({
                    url:"/oms/order/selectOrderDetail",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.modifyOrderDetail = res.data
                    orderApp.modifyOrderDetail.ItemPJName = orderApp.modifyOrderDetail.itemId + orderApp.modifyOrderDetail.returnItemName
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 修改 查询产品详情
            modifyOrderSelectDrugInfoList:function () {
                let form = new FormData();
                form.append("itemDescription", orderApp.modifyOrderDetail.ItemPJName);
                axios({
                    url:"/oms/drug/selectDrugInfoList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.modifyOrderDrugInfoList = res.data.list;
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 修改 选择库存
            modifyOrderCheckThisDrugInfo:function (stockId,departmentIdName,itemId,itemDescription,unitName) {
                orderApp.modifyOrderDetail.stockId = stockId
                orderApp.modifyOrderDetail.itemId = itemId
                orderApp.modifyOrderDetail.ItemPJName = '库存ID:' + stockId + ' 药房名称:' + departmentIdName + ' 产品:' + itemId + ' ' + itemDescription
                orderApp.modifyOrderDetail.sendDoseUnitName = unitName

                // 根据产品ID找产品返回频次详情等信息
                let form = new FormData();
                form.append("itemId",itemId);
                axios({
                    url:"/oms/item/selectItemDetail",
                    method:"post",
                    data:form
                }).then(function (res) {
                    orderApp.modifyOrderDetail.frequencyDetail = res.data.frequencyDetail
                    orderApp.modifyOrderDetail.supplementaryFrequencyDetail = res.data.supplementaryFrequencyDetail
                    orderApp.modifyOrderDetail.mealTimeDetail = res.data.mealTimeDetail
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 修改 修改医嘱
            modifySaveOrder:function (orderId) {
                // 根据产品ID找产品返回频次详情等信息
                let form = new FormData();
                form.append("orderId",orderId);
                form.append("itemId",this.modifyOrderDetail.itemId);
                form.append("sendDose",this.modifyOrderDetail.sendDose);
                form.append("sendDoseUnitName",this.modifyOrderDetail.sendDoseUnitName);
                form.append("frequencyDetail",this.modifyOrderDetail.frequencyDetail);
                form.append("supplementaryFrequencyDetail",this.modifyOrderDetail.supplementaryFrequencyDetail);
                form.append("mealTimeDetail",this.modifyOrderDetail.mealTimeDetail);
                axios({
                    url:"/oms/order/updateOrder",
                    method:"post",
                    data:form
                }).then(function (res) {
                   if (res.data=='ok'){
                       alert("修改成功！！！")
                       location.reload()
                   }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 删除医嘱
            deleteOrder:function (orderId) {
                axios({
                    url:"/oms/order/deleteOrder/" + orderId,
                    method:"get",
                }).then(function (res) {
                    if (res.data=='ok'){
                        alert("删除成功！！！")
                        location.reload()
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 医嘱签名
            modifyOrderDoctorSignature:function (orderId) {
                let confirm = window.confirm("签名以后无法对医嘱进行修改，是否确认签名？")
                if (!confirm){
                    return
                }else {
                    let form = new FormData();
                    form.append("orderId",orderId);
                    form.append("doctorSignatureFlag",'1');
                    axios({
                        url:"/oms/order/orderSignature",
                        method:"post",
                        data:form
                    }).then(function (res) {
                        if (res.data=='ok'){
                            alert("签名成功！！！")
                            location.reload()
                        }
                    }).catch(function(error){
                        //失败运行这里,输出错误信息
                        alert(error)
                        console.log(error);
                    })
                }
            },
            // 医嘱批量签名
            modifyOrderDoctorSignatureList:function (orderId) {
                let confirm = window.confirm("此操作会对此医嘱对应处方的所有医嘱进行医嘱签名操作，是否继续进行批量签名？")
                if (!confirm){
                    return
                }else {
                    let form = new FormData();
                    form.append("orderId",orderId);
                    form.append("doctorSignatureFlag",'1');
                    axios({
                        url:"/oms/order/orderSignatureList",
                        method:"post",
                        data:form
                    }).then(function (res) {
                        if (res.data=='ok'){
                            alert("批量签名成功！！！")
                            location.reload()
                        }
                    }).catch(function(error){
                        //失败运行这里,输出错误信息
                        alert(error)
                        console.log(error);
                    })
                }
            }

        },
        created:function () {
            this.selectOrderListButton()
        }
    })

</script>

</body>
</html>
